<%-- 
    Document   : gererCommande.jsp
    Created on : Dec 10, 2012, 9:33:55 AM
    Author     : himanshu
--%>

<%@page import="com.myapp.struts.Commande"%>
<%-- 
    Document   : gererFilm.jsp
    Created on : Dec 9, 2012, 6:13:13 AM
    Author     : himanshu
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.myapp.struts.Film"%>
<%@page import="com.myapp.persistance.BaseDeDonnee"%>
<%@page import="java.sql.Connection"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@include file="commun.jsp" %>
<%= entete("BOUTIKONLINE")%>
<%@include file="Header_Commercant.jsp" %>

  
 <div class="texte">
                  

                           <table border="1">
                               <tr bgcolor="#00BBBB">
                                   <td>Numero_Commande</td>
                                   <td>Etat</td>
                                   <td>Prix</td>
                                   <td>Date commande</td>
                                   <td>Date livraison</td>
                                   <td bgcolor="#FFCC00">Supprimer</td>
                                   <td bgcolor="#FFCC00">Changer Etat</td>
                                   
                               </tr>
                              
                              
                               
                               <%   
                               //instantiating database class
                                    BaseDeDonnee bd = new BaseDeDonnee();
                                    //connection to database
                                    Connection con =  bd.connecter();
                                    //get the film list
                                    List<Commande> liste = new ArrayList<Commande>();
                                    
                                    
                                    liste= bd.gererCommande(con);
                                    
                                    
                                    if (liste !=null && !liste.isEmpty()){
                                    
                                        for(Commande c : liste){
                                %>
                               
                                <tr>
                                    <td><%=c.getNumeroCommande()%></td>
                                    <td><%=c.getEtatDeCommande()%></td>
                                    <td><%=c.getPrixTotale()%></td>
                                    <td><%=c.getDateDeCommande()%></td>
                                    <td><%=c.getDateDeLivraison()%></td>
                                    <td>
                                        <html:form action="/supprimercommande">
                                            
                                            <html:hidden name="Commande" property="numeroCommande" value="<%=Integer.toString(c.getNumeroCommande())%>" />
                                            <html:submit value="supprimer" styleClass="text-button"/>
                                            
                                        </html:form>
                                    </td>
                                    <td>
                                        <html:form action="/changeretat">
                                            
                                            <html:hidden name="Commande" property="numeroCommande" value="<%=Integer.toString(c.getNumeroCommande())%>" />
                                            <html:submit value="Changer Etat" styleClass="text-button"/>
                                            
                                        </html:form>
                                    </td>
                                </tr>
                                
                                
                                
                               
                                <%  }
                                  } 
                                %>
                           </table>

                           
                  

</div>

<%@include file="Pied.jsp" %>%>

